﻿#ifndef PICTURELAYER_H
#define PICTURELAYER_H
#include<QTime>
#include <QWidget>
#include<Don_tModify/stackwindow.h>
#include<Don_tModify/mousefilter.h>
#include<QPainter>
#include<QCursor>
#include<QMouseEvent>
#include<QPoint>
#include<QApplication>
#include<helicopter.h>
#include<QVector>
#include<QMap>
#include<Infrequent/sprite.h>
#include<Infrequent/enemyplane.h>
#include<Infrequent/enemytank.h>
#include<Infrequent/enemybunker.h>
#include<Infrequent/frienddrone.h>
#include<QtCore/qmath.h>

class PictureLayer : public StackWindow
{
    Q_OBJECT
public:
    explicit PictureLayer(QWidget *parent,const Qt::AlignmentFlag &v_alignment,const Qt::AlignmentFlag &h_alignment,const QPoint &pos);
    void paintEvent(QPaintEvent*);
    //generate things
    void generateEnemyPlane();
    void generateFriendDrone();
    void generateEnemyTank();
    void generateEnemyBunker();
    void removeVector();

    MouseFilter *mouseFilter;
    Helicopter *helicopter;
    QVector<Sprite*>elementVector;
    QVector<FriendDrone*>responseVector;
    QMap<int,FriendDrone*>responseMap;
    void generateResponse();
    void initElementVector();
    void initResponseVector();
protected:
    void mousePressEvent(QMouseEvent *event) override ;
    void mouseMoveEvent(QMouseEvent *event) override ;
    void mouseReleaseEvent(QMouseEvent *event) override;

signals:
    void generateEnemyPlaneSignal();
    void generateEnemyTankSignal();
    void generateEnemyBunkerSignal();
    void generateFriendDroneSignal();
    void generatePlaneMarkerSignal();
public:
    QPointF delta;
    QPointF temp;
    QPointF translatePos;
    QPointF mousePos=QPointF(0,0);
    bool isPress=false;
    bool DroneResponse=false;
    int paintingStatus=0;
public slots:

};

#endif // PICTURELAYER_H
